package bagu.set;

import java.security.Key;
import java.util.Map;
import java.util.TreeMap;

public class TreeMapDemo01 {
    public static void main(String[] args) {
        TreeMap<Integer, String> treeMap = new TreeMap<>((a, b)-> (b - a));
        treeMap.put(1, "苹果");
        treeMap.put(3, "香蕉");
        treeMap.put(2, "橙子");



        treeMap.forEach((key, value) -> {
            System.out.println(key + ":" + value);
        });

    }
}
